class Commitment implements Comparable {

    static belongsTo = [user: User, commitmentType: CommitmentType]

    Date dateCreated
    int value
    String description
    int balance = 0

    static constraints = {
        value(blank: false)
        description(blank: false)
    }

    /**
     *  Ostatnie operacje na początku
     */
    int compareTo(obj) {
        -dateCreated.compareTo(obj.dateCreated)
   }

}
